package com.dslu.fx.utils;

import com.dslu.fx.vo.BigDzpChildrenVO;
import com.dslu.fx.vo.BigDzpVO;
import com.dslu.fx.vo.DateUtil;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;


import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

public class DrawTableImg {

    /**
     * 生成图片
     *
     * @param cellsValue 以二维数组形式存放 表格里面的值
     * @param path       文件保存路径
     */
    public void myGraphicsGeneration(String cellsValue[][], String path) {
        // 字体大小
        int fontTitileSize = 15;
        // 横线的行数
        int totalrow = cellsValue.length + 1;
        // 竖线的行数
        int totalcol = 0;
        if (cellsValue[0] != null) {
            totalcol = cellsValue[0].length;
        }
        // 图片宽度
        int imageWidth = 1024;
        // 行高
        int rowheight = 40;
        // 图片高度
        int imageHeight = totalrow * rowheight + 50;
        // 起始高度
        int startHeight = 10;
        // 起始宽度
        int startWidth = 10;
        // 单元格宽度
        int colwidth = (int) ((imageWidth - 20) / totalcol);
        BufferedImage image = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);
        Graphics graphics = image.getGraphics();
        graphics.setColor(Color.WHITE);
        graphics.fillRect(0, 0, imageWidth, imageHeight);
        graphics.setColor(new Color(220, 240, 240));

        //画横线
        for (int j = 0; j < totalrow; j++) {
            graphics.setColor(Color.black);
            graphics.drawLine(startWidth, startHeight + (j + 1) * rowheight, startWidth + colwidth * totalcol, startHeight + (j + 1) * rowheight);
        }
        //画竖线
        for (int k = 0; k < totalcol + 1; k++) {
            graphics.setColor(Color.black);
            graphics.drawLine(startWidth + k * colwidth, startHeight + rowheight, startWidth + k * colwidth, startHeight + rowheight * totalrow);
        }
        //设置字体
        Font font = new Font("微软雅黑", Font.BOLD, fontTitileSize);
        graphics.setFont(font);
        //写标题
        // String title = "【指标完成进度】";
        //graphics.drawString(title, startWidth, startHeight + rowheight - 10);
        //写入内容
        for (int n = 0; n < cellsValue.length; n++) {
            for (int l = 0; l < cellsValue[n].length; l++) {
                if (n == 0) {
                    font = new Font("微软雅黑", Font.BOLD, fontTitileSize);
                    graphics.setFont(font);
                } else if (n > 0 && l > 0) {
                    font = new Font("微软雅黑", Font.PLAIN, fontTitileSize);
                    graphics.setFont(font);
                    graphics.setColor(Color.RED);
                } else {
                    font = new Font("微软雅黑", Font.PLAIN, fontTitileSize);
                    graphics.setFont(font);
                    graphics.setColor(Color.BLACK);
                }
                graphics.drawString(cellsValue[n][l].toString(), startWidth + colwidth * l + 5, startHeight + rowheight * (n + 2) - 10);
            }
        }
        // 保存图片
        createImage(image, path);
    }


    public static void myGraphicsGeneration2(String cellsValue[][], String path) {
        // 字体大小
        int fontTitileSize = 15;
        // 横线的行数
        int totalrow = cellsValue.length + 1;
        // 竖线的行数
        int totalcol = 0;
        if (cellsValue[0] != null) {
            totalcol = cellsValue[0].length;
        }
        // 图片宽度
        int imageWidth = 760;
        // 行高
        int rowheight = 40;
        // 图片高度
        int imageHeight = totalrow * rowheight + 50;
        // 起始高度
        int startHeight = 10;
        // 起始宽度
        int startWidth = 10;
        // 单元格宽度
        int colwidth = (int) ((imageWidth - 20) / totalcol);
        BufferedImage image = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);
        Graphics graphics = image.getGraphics();
        graphics.setColor(Color.WHITE);

        graphics.fillRect(0, 0, imageWidth, imageHeight);
        graphics.setColor(new Color(220, 240, 240));

        //画横线
        for (int j = 0; j < totalrow; j++) {
            graphics.setColor(Color.black);
            graphics.drawLine(startWidth, startHeight + (j + 1) * rowheight, startWidth + colwidth * totalcol, startHeight + (j + 1) * rowheight);
        }
        //画竖线
        for (int k = 0; k < totalcol + 1; k++) {
            graphics.setColor(Color.black);
            graphics.drawLine(startWidth + k * colwidth, startHeight + rowheight, startWidth + k * colwidth, startHeight + rowheight * totalrow);
        }
        //设置字体
        Font font = new Font("微软雅黑", Font.BOLD, fontTitileSize);
        graphics.setFont(font);
        //写标题
        // String title = "【指标完成进度】";
        //graphics.drawString(title, startWidth, startHeight + rowheight - 10);
        //写入内容
        for (int n = 0; n < cellsValue.length; n++) {
            for (int l = 0; l < cellsValue[n].length; l++) {
                if (n == 0) {
                    font = new Font("微软雅黑", Font.BOLD, fontTitileSize);
                    graphics.setFont(font);
                    graphics.drawString(cellsValue[n][l].toString(), startWidth + colwidth * l + 100 - cellsValue[n][l].toString().length() * 4, startHeight + rowheight * (n + 2) - 10);

                } else if (n > 0 && l > 0) {
                    font = new Font("微软雅黑", Font.PLAIN, fontTitileSize);
                    graphics.setFont(font);
                    graphics.setColor(Color.RED);
                    graphics.drawString(cellsValue[n][l].toString(), startWidth + colwidth * l + 100 - cellsValue[n][l].toString().length() * 4, startHeight + rowheight * (n + 2) - 10);
                } else {
                    font = new Font("微软雅黑", Font.PLAIN, fontTitileSize);
                    graphics.setFont(font);
                    graphics.setColor(Color.BLACK);
                    graphics.drawString(cellsValue[n][l].toString(), startWidth + colwidth * l + 100 - cellsValue[n][l].toString().length() * 4, startHeight + rowheight * (n + 2) - 10);
                }

            }
        }
        // 保存图片
        createImage(image, path);
    }

    public static void myGraphicsGeneration3(String cellsValue[][], String path) {
        // 字体大小
        int fontTitileSize = 15;
        // 横线的行数
        int totalrow = cellsValue.length + 1;
        // 竖线的行数
        int totalcol = 0;
        if (cellsValue[0] != null) {
            totalcol = cellsValue[0].length;
        }
        // 图片宽度
        int imageWidth = 760;
        // 行高
        int rowheight = 40;
        // 图片高度
        int imageHeight = totalrow * rowheight + 50;
        // 起始高度
        int startHeight = 10;
        // 起始宽度
        int startWidth = 10;
        // 单元格宽度
        int colwidth = (int) ((imageWidth - 20) / totalcol);
        BufferedImage image = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);
        Graphics graphics = image.getGraphics();
        graphics.setColor(Color.WHITE);
        graphics.fillRect(0, 0, imageWidth, imageHeight);
        graphics.setColor(new Color(220, 240, 240));

        //画横线
        for (int j = 0; j < totalrow; j++) {
            graphics.setColor(Color.black);
            graphics.drawLine(startWidth, startHeight + (j + 1) * rowheight, startWidth + colwidth * totalcol, startHeight + (j + 1) * rowheight);
        }
        //画竖线
        for (int k = 0; k < totalcol + 1; k++) {
            graphics.setColor(Color.black);
            graphics.drawLine(startWidth + k * colwidth, startHeight + rowheight, startWidth + k * colwidth, startHeight + rowheight * totalrow);
        }
        //设置字体
        Font font = new Font("微软雅黑", Font.BOLD, fontTitileSize);
        graphics.setFont(font);
        //写标题
        // String title = "【指标完成进度】";
        //graphics.drawString(title, startWidth, startHeight + rowheight - 10);
        //写入内容
        for (int n = 0; n < cellsValue.length; n++) {
            for (int l = 0; l < cellsValue[n].length; l++) {
                if (n == 0) {
                    font = new Font("微软雅黑", Font.BOLD, fontTitileSize);
                    graphics.setFont(font);
                    graphics.drawString(cellsValue[n][l].toString(), startWidth + colwidth * l + 80 - cellsValue[n][l].toString().length() * 4, startHeight + rowheight * (n + 2) - 10);

                } else if (n > 0 && l > 0) {
                    font = new Font("微软雅黑", Font.PLAIN, fontTitileSize);
                    graphics.setFont(font);
                    graphics.setColor(Color.RED);
                    graphics.drawString(cellsValue[n][l].toString(), startWidth + colwidth * l + 100 - cellsValue[n][l].toString().length() * 4, startHeight + rowheight * (n + 2) - 10);
                } else {
                    font = new Font("微软雅黑", Font.PLAIN, fontTitileSize);
                    graphics.setFont(font);
                    graphics.setColor(Color.BLACK);
                    graphics.drawString(cellsValue[n][l].toString(), startWidth + colwidth * l + 70 - cellsValue[n][l].toString().length() * 4, startHeight + rowheight * (n + 2) - 10);
                }

            }
        }
        // 保存图片
        createImage(image, path);
    }

    public static void myGraphicsGeneration4(String cellsValue[][], String path) throws IOException {
        // 字体大小
        int fontTitileSize = 100;
        // 横线的行数
        int totalrow = cellsValue.length + 1;
        // 竖线的行数
        int totalcol = 0;
        if (cellsValue[0] != null) {
            totalcol = cellsValue[0].length;
        }
        BufferedImage bufferedImage = ImageIO.read(new File("d:\\bg.jpg"));
        int imageWidth = bufferedImage.getWidth();
        int imageHeight = bufferedImage.getHeight();
        // 图片宽度
        // int imageWidth = 760;
        // 行高
        int rowheight = 240;
        // 图片高度
        //int imageHeight = totalrow * rowheight + 50;
        // 起始高度
        int startHeight = 250;
        // 起始宽度
        int startWidth = 450;
        // 单元格宽度
        int colwidth = (int) ((imageWidth - 20) / totalcol);

        Graphics graphics = bufferedImage.createGraphics();

       /* BufferedImage image = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);
        Graphics graphics = image.getGraphics();
        graphics.setColor(Color.WHITE);
        graphics.fillRect(0, 0, imageWidth, imageHeight);
        graphics.setColor(new Color(220, 240, 240));*/

        //画横线
       /* for (int j = 0; j < totalrow; j++) {
            graphics.setColor(Color.white);
            graphics.drawLine(startWidth, startHeight + (j + 1) * rowheight, startWidth + colwidth * totalcol, startHeight + (j + 1) * rowheight);
        }*/
        //画竖线
       /* for (int k = 0; k < totalcol + 1; k++) {
            graphics.setColor(Color.white);
            graphics.drawLine(startWidth + k * colwidth, startHeight + rowheight, startWidth + k * colwidth, startHeight + rowheight * totalrow);
        }*/
        //设置字体
        Font font = new Font("微软雅黑", Font.BOLD, fontTitileSize);
        graphics.setFont(font);
        //写标题
        // String title = "【指标完成进度】";
        //graphics.drawString(title, startWidth, startHeight + rowheight - 10);
        //写入内容
        for (int n = 0; n < cellsValue.length; n++) {
            for (int l = 0; l < cellsValue[n].length; l++) {
                if (n == 0) {
                    font = new Font("微软雅黑", Font.BOLD, fontTitileSize);
                    graphics.setFont(font);
                    graphics.drawString(cellsValue[n][l].toString(), startWidth + colwidth * l + 80 - cellsValue[n][l].toString().length() * 40, startHeight + rowheight * (n + 2) - 10);

                } else if (n > 0 && l > 0) {
                    font = new Font("微软雅黑", Font.PLAIN, fontTitileSize);
                    graphics.setFont(font);
                    graphics.setColor(Color.white);
                    graphics.drawString(cellsValue[n][l].toString(), startWidth + colwidth * l + 100 - cellsValue[n][l].toString().length() * 40, startHeight + rowheight * (n + 2) - 10);
                } else {
                    font = new Font("微软雅黑", Font.PLAIN, fontTitileSize);
                    graphics.setFont(font);
                    graphics.setColor(Color.white);
                    graphics.drawString(cellsValue[n][l].toString(), startWidth + colwidth * l + 70 - cellsValue[n][l].toString().length() * 40, startHeight + rowheight * (n + 2) - 10);
                }

            }
        }
        // 保存图片
        createImage(bufferedImage, path);
    }


    public static void myGraphicsGeneration5(String cellsValue[][], String path) throws IOException {
        // 字体大小
        int fontTitileSize = 30;
        // 横线的行数
        int totalrow = cellsValue.length + 1;
        // 竖线的行数
        int totalcol = 0;
        if (cellsValue[0] != null) {
            totalcol = cellsValue[0].length;
        }
        BufferedImage bufferedImage = ImageIO.read(new File("d:\\bg2.jpg"));
        int imageWidth = bufferedImage.getWidth();
        int imageHeight = bufferedImage.getHeight();
        // 图片宽度
        // int imageWidth = 760;
        // 行高
        int rowheight = 240;
        // 图片高度
        //int imageHeight = totalrow * rowheight + 50;
        // 起始高度
        int startHeight = 250;
        // 起始宽度
        int startWidth = 450;
        // 单元格宽度
        int colwidth = (int) ((imageWidth - 20) / totalcol);

        Graphics graphics = bufferedImage.createGraphics();

        //设置字体
        Font font = new Font("微软雅黑", Font.BOLD, fontTitileSize);
        graphics.setFont(font);
        //写标题
        //String title = "战勤保证物资调度清单";
        //graphics.drawString(title, startWidth, startHeight + rowheight - 10);
        //单号
        String batchNo = "单号：EM185847856585996";
        graphics.drawString(batchNo, 50, 250);

        //时间
        String time = "时间：2021-04-06 15:42:10";
        graphics.drawString(time, 1600, 250);

        //画框
        //横线
        graphics.drawLine(30, 300, 2050, 300);
        //竖线
        graphics.drawLine(30, 300, 30, 450);
        graphics.drawLine(500, 300, 500, 450);
        graphics.drawLine(2050, 300, 2050, 450);
        //横线
        graphics.drawLine(30, 450, 2050, 450);

        //出动车辆
        String carTitle = "出动车辆";
        graphics.drawString(carTitle, 200, 380);


        //写入内容
        int preHight=0;


        for (int n = 0; n < cellsValue.length; n++) {
            for (int l = 0; l < cellsValue[n].length; l++) {
                if (n == 0) {
                    preHight=510;
                    if (l == 0) {
                        //第一行第一列
                        //画竖线
                        graphics.drawLine(30, 450, 30, 560);
                        //内容
                        graphics.drawString(cellsValue[n][l].toString(), 230, 510);
                        //画竖线
                        graphics.drawLine(500, 450, 500, 560);
                    } else if (l == 1) {
                        //第一行第二列
                        graphics.drawString(cellsValue[n][l].toString(), 600, 510);
                        //画竖线
                        graphics.drawLine(750, 450, 750, 560);

                    } else if (l == 2) {
                        //第一行第三列
                        graphics.drawString(cellsValue[n][l].toString(), 1200, 510);
                        //画竖线
                        graphics.drawLine(1800, 450, 1800, 560);
                    } else if (l == 3) {
                        //第一行第四列
                        graphics.drawString(cellsValue[n][l].toString(), 1900, 510);
                        //画竖线
                        graphics.drawLine(2050, 450, 2050, 560);
                    }

                   /* else if (n > 0 && l > 0) {
                        //graphics.drawString(cellsValue[n][l].toString(), startWidth + colwidth * l + 100-cellsValue[n][l].toString().length()*40, startHeight + rowheight * (n + 2) - 10);
                    } else {
                        // graphics.drawString(cellsValue[n][l].toString(), startWidth + colwidth * l + 70-cellsValue[n][l].toString().length()*40, startHeight + rowheight * (n + 2) - 10);
                    }*/

                } else {
                    //计算起始高度
                    String hightText = cellsValue[n][2].toString();
                    //int startHight=450+(n+1)*100;
                    int startHight=preHight+140;
                    int endHight=startHight+40;
                    int num=1;
                    if(hightText.length()>25) {
                        //切割
                        double hightv = hightText.length() / 25.0;
                        num = (int) Math.ceil(hightv);
                        endHight=startHight+(num-1)*40;
                    }

                    preHight=endHight;

                    //graphics.drawString(cellsValue[n][l].toString(), 1,510+(n+1)*100);

                    if (l == 0) {
                        //第n行第一列
                        //内容
                        System.out.println((startHight+endHight)/2);
                        graphics.drawString(cellsValue[n][l].toString(), 150, (startHight+endHight)/2);
                        //画竖线
                        //graphics.drawLine(500, 450, 500, 560);
                    } else if (l == 1) {
                        //第n行第二列
                        graphics.drawString(cellsValue[n][l].toString(), 580, (startHight+endHight)/2);
                        //画竖线
                        //graphics.drawLine(750, 450, 750, 560);

                    } else if (l == 2) {
                        //第n行第三列
                        String text = cellsValue[n][l].toString();
                        for (int i=0;i<num;i++){
                            int end = 25 * (i + 1) >= text.length() ? text.length() : 25 * (i + 1);
                            String content = text.substring(i * 25, end);
                            graphics.drawString(content, 1000, startHight+i*40);
                        }


                      /* if(text.length()>25){
                        //切割
                           double v = text.length()/25.0;
                           int num = (int) Math.ceil(v);
                           for (int i=0;i<num;i++){
                               int end = 25 * (i + 1) >= text.length() ? text.length() : 25 * (i + 1);
                               String content = text.substring(i * 25, end);
                                graphics.drawString(content, 1000, 450+(n+1)*100+i*40);
                           }

                       }else {
                           graphics.drawString(cellsValue[n][l].toString(), 1000, (startHight+endHight)/2);
                       }*/
                        //画竖线
                       // graphics.drawLine(1800, 450, 1800, 560);
                    } else if (l == 3) {
                        //第n行第四列
                        graphics.drawString(cellsValue[n][l].toString(), 1880, (startHight+endHight)/2);
                        //画竖线
                        //graphics.drawLine(2050, 450, 2050, 560);
                    }

                }

            }
        }
        //横线(第一行下边)
        graphics.drawLine(30, 560, 2050, 560);

        // 保存图片
        createImage(bufferedImage, path);
    }



    public static void myGraphicsGeneration6(BigDzpVO bigDzpVO, String path) throws IOException {
        // 字体大小
        int fontTitileSize = 30;
        BufferedImage bufferedImage = ImageIO.read(new File("d:\\bg2.jpg"));
        Graphics graphics = bufferedImage.createGraphics();
        //设置字体
        Font font = new Font("微软雅黑", Font.BOLD, fontTitileSize);
        graphics.setFont(font);
        //写标题
        //String title = "战勤保证物资调度清单";
        //graphics.drawString(title, startWidth, startHeight + rowheight - 10);
        //单号
        String batchNo = "单号："+bigDzpVO.getBatchNo();
        graphics.drawString(batchNo, 50, 250);

        //时间
        String time = "时间："+bigDzpVO.getTime();
        graphics.drawString(time, 1600, 250);

        //画框
        //横线
        graphics.drawLine(30, 300, 2050, 300);
        //竖线
        graphics.drawLine(30, 300, 30, 450);
        graphics.drawLine(500, 300, 500, 450);
        graphics.drawLine(2050, 300, 2050, 450);
        //横线
        graphics.drawLine(30, 450, 2050, 450);

        //出动车辆
        String carTitle = "出动车辆";
        graphics.drawString(carTitle, 200, 380);

        graphics.drawString(bigDzpVO.getCars(), 600, 380);

        //类别
        graphics.drawLine(30, 450, 30, 560);
        //内容
        graphics.drawString("类别", 230, 510);
        //画竖线
        graphics.drawLine(500, 450, 500, 560);

        //库位
        graphics.drawString("库位", 600, 510);
        //画竖线
        graphics.drawLine(750, 450, 750, 560);

        //装备名称
        graphics.drawString("装备名称", 1200, 510);
        //画竖线
        graphics.drawLine(1800, 450, 1800, 560);

        //状态
        graphics.drawString("状态", 1900, 510);
        //画竖线
        graphics.drawLine(2050, 450, 2050, 560);

        //横线(第一行下边)
        graphics.drawLine(30, 560, 2050, 560);

        //写入内容
        int preHight=560;
        for (BigDzpChildrenVO bigDzpChildrenVO:bigDzpVO.getList()){
            int startHeight=preHight;
            int endHeight=startHeight+100;
            int num=1;
            String prodName = bigDzpChildrenVO.getProdName();
            if(prodName.length()>25) {
                //切割
                double hightv = prodName.length() / 25.0;
                num = (int) Math.ceil(hightv);
                endHeight=endHeight+(num-1)*40;
            }
            preHight=endHeight;

            graphics.drawLine(30, startHeight, 30, endHeight);
            //内容
            graphics.drawString(bigDzpChildrenVO.getCategoryName(), 150, ((startHeight+endHeight)/2)+10);
            //画竖线
            graphics.drawLine(500, startHeight, 500, endHeight);

            graphics.drawString(bigDzpChildrenVO.getDepartName(), 580, ((startHeight+endHeight)/2)+10);
            graphics.drawLine(750, startHeight, 750, endHeight);

            String text = bigDzpChildrenVO.getProdName();
            for (int i=0;i<num;i++){
                int end = 25 * (i + 1) >= text.length() ? text.length() : 25 * (i + 1);
                String content = text.substring(i * 25, end);
                graphics.drawString(content, 1000, startHeight+50+i*40+10);
            }

            graphics.drawLine(1800, startHeight, 1800, endHeight);

            graphics.drawString(bigDzpChildrenVO.getStatus(), 1880, ((startHeight+endHeight)/2)+10);

            graphics.drawLine(2050, startHeight, 2050, endHeight);

            graphics.drawLine(30, endHeight, 2050, endHeight);
        }
        // 保存图片
        createImage(bufferedImage, path);
    }

    /**
     * 将图片保存到指定位置
     *
     * @param image        缓冲文件类
     * @param fileLocation 文件位置
     */
    public static void createImage(BufferedImage image, String fileLocation) {
        try {
            FileOutputStream fos = new FileOutputStream(fileLocation);
            BufferedOutputStream bos = new BufferedOutputStream(fos);
            JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bos);
            encoder.encode(image);
            bos.close();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }


    public static void main(String[] args) {
        //DrawTableImg cg = new DrawTableImg();
        try {
            // String tableData1[][] = {{"8月31日","累计用户数","目标值","完成进度","时间进度", "进度差异"}, {"掌厅客户端（户）","469281","1500000","31.2%","33.6%", "-2.4%"}};
  /*          String[][] tableData2 = {
                    {"8月31日（户）","新增用户数","日访问量","累计用户数","环比上月"},
                    {"合肥和巢湖","469281","1500000","31.2%","33.6%"},
                    {"芜湖","469281","1500000","31.2%","33.6%"},
                    {"蚌埠","469281","1500000","31.2%","33.6%"},
                    {"淮南","469281","1500000","31.2%","33.6%"},
                    {"马鞍山","469281","1500000","31.2%","33.6%"},
                    {"淮北","469281","1500000","31.2%","33.6%"}};
            cg.myGraphicsGeneration(tableData2, "d:\\myPic.jpg");*/
            /*/String[][] tableData3 ={
                    {"物资名称","规格","数量","单位"},
                    {"通讯头盔","11","1","顶"},
                    {"消防安全绳","11","45","根"},
                    {"消防安全绳30米","11","30","根"},
                    {"消防安全绳50米","11","45","根"},
                    {"消防胶靴","11","50","双"},
            };
            DrawTableImg.myGraphicsGeneration4(tableData3, "d:\\tableData4.jpg");*/

            /*String[][] tableData4 ={
                    {"库位名称","状态"},
                    {"A2-1","待出库"},
                    {"A2-2","已出库"},
                    {"A2-3","待出库"},
                    {"A2-4","已出库"},
                    {"A2-5","已出库"},
            };*/

           /* String[][] tableData5 = {
                    {"类别", "库位", "装备名称", "状态"},
                    {"总队带储存装备", "K2-02", "消防员水域救援防护服25件", "待出库"},
                    {"总队带储存装备", "K2-03", "望远镜3个，水域救援切割刀27把，望远镜3个水域救援切割刀27把，望远镜3个，水域救援切割刀27把", "待出库"},
                    {"总队带储存装备", "K2-01", "消防员水域救援防护服25件", "待出库"},
            };

            DrawTableImg.myGraphicsGeneration5(tableData5, "d:\\tableData6.jpg");*/

            BigDzpVO bigDzpVO=new BigDzpVO();
            bigDzpVO.setBatchNo("EM185847856585996");
            bigDzpVO.setCars("皖·X6062应急，皖X6046应急，皖X6150应急，皖X6049应急，皖X6049应急");
            bigDzpVO.setTime(DateUtil.getDateTime());

            List<BigDzpChildrenVO> list=new ArrayList<>();
            BigDzpChildrenVO bigDzpChildrenVO=new BigDzpChildrenVO();
            bigDzpChildrenVO.setCategoryName("总队带储存装备");
            bigDzpChildrenVO.setDepartName("K2-02");
            bigDzpChildrenVO.setProdName("消防员水域救援防护服25件");
            bigDzpChildrenVO.setStatus("待出库");
            list.add(bigDzpChildrenVO);


            BigDzpChildrenVO bigDzpChildrenVO1=new BigDzpChildrenVO();
            bigDzpChildrenVO1.setCategoryName("总队带储存装备");
            bigDzpChildrenVO1.setDepartName("K2-02");
            bigDzpChildrenVO1.setProdName("望远镜3个，水域救援切割刀27把，望远镜3个水域救援切割刀27把，望远镜3个，水域救援切割刀27把");
            bigDzpChildrenVO1.setStatus("待出库");
            list.add(bigDzpChildrenVO1);


            BigDzpChildrenVO bigDzpChildrenVO2=new BigDzpChildrenVO();
            bigDzpChildrenVO2.setCategoryName("总队带储存装备");
            bigDzpChildrenVO2.setDepartName("K2-02");
            bigDzpChildrenVO2.setProdName("消防员水域救援防护服25件");
            bigDzpChildrenVO2.setStatus("待出库");
            list.add(bigDzpChildrenVO2);

            bigDzpVO.setList(list);

            DrawTableImg.myGraphicsGeneration6(bigDzpVO, "d:\\tableData7.jpg");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
